/* GUI CONVERTED from ppptcgc2.p (converter v1.76) Fri Apr 11 02:19:34 2003 */
/* ppptcgc2.p - CHANGE PART NUMBER SUBROUTINE                           */
/* Copyright 1986-2003 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.8.1.3 $                                                         */
/*V8:ConvertMode=Maintenance                                            */
/* REVISION: 7.2      LAST MODIFIED: 04/01/93   BY: pma *G900*          */
/* REVISION: 7.4    LAST MODIFIED: 01/14/97  BY: *H0R3*  Russ Witt      */
/* REVISION: 7.4    LAST MODIFIED: 05/05/97  BY: *H0YR* Julie Milligan  */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan   */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/13/00 BY: *N0KQ* myb              */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.8.1.3 $    BY: Narathip W.           DATE: 04/10/03  ECO: *P0PS*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */
{cxcustom.i "PPPTCGC2.P"}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE ppptcgc2_p_1 "Records!Updated"
/* MaxLen: Comment: */

&SCOPED-DEFINE ppptcgc2_p_2 "Old Item Number"
/* MaxLen: Comment: */

&SCOPED-DEFINE ppptcgc2_p_3 "New Item Number"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define shared stream prt.

define shared variable record_no as recid.
define shared variable comp like ps_comp.
define shared variable part1 like ps_par label {&ppptcgc2_p_2}.
define shared variable part2 like ps_par label {&ppptcgc2_p_3}.
define shared frame b.
define variable i as integer.

define variable k as integer.
define variable l as integer.

/*VARIABLE DEFINITIONS FOR GPFILE.I*/
{gpfilev.i}

{&PPPTCGC2-P-TAG1}
FORM /*GUI*/ 
   part1 part2 pt_desc1 format "x(30)"
   i    column-label {&ppptcgc2_p_1}
with frame b width 80 down no-attr-space no-box THREE-D /*GUI*/.

{&PPPTCGC2-P-TAG2}

/* SET EXTERNAL LABELS */
setFrameLabels(frame b:handle).

do with frame b:

   k = 0.
   l = 0.

   for each cs_mstr where cs_set >= "" no-lock with frame b:
/*GUI*/ if global-beam-me-up then undo, leave.


      accum "" (count).

      count = 0.
      {mfptcgb.i sct_det sct_part "part1 and sct_sim = cs_set"
         part2 "stream prt" false}
      k = k + count.

      for each si_mstr where si_site >= "" no-lock with frame b:
/*GUI*/ if global-beam-me-up then undo, leave.

         count = 0.
         {mfptcgb.i spt_det spt_part
            "part1 and spt_sim = cs_set and spt_site = si_site"
            part2 "stream prt" false}
         l = l + count.
      end.
/*GUI*/ if global-beam-me-up then undo, leave.


   end.
/*GUI*/ if global-beam-me-up then undo, leave.


   if k <> 0 then do with frame b:
      {gpfile.i &file_name='sct_det'}
      /*fdn display stream prt file_desc @ pt_desc1 k @ i. */
      /*fdn*/ display stream prt "sct_part" @ part1 string(time, "hh:mm:ss") @ part2 "sct_det" @ pt_desc1 k @ i.
      down stream prt 1.
   end.

   if l <> 0 then do with frame b:
      {gpfile.i &file_name='spt_det'}
      /*fdn display stream prt file_desc @ pt_desc1 l @ i. */
      /*fdn*/ display stream prt "spt_part" @ part1 string(time, "hh:mm:ss") @ part2 "spt_det" @ pt_desc1 l @ i.
      down stream prt 1.
   end.

   count = 0.
end.
